package com.yoo.ons.function.album.viewmodel

import androidx.recyclerview.widget.RecyclerView
import com.yoo.module_base.base.Activities
import com.yoo.module_base.utils.PictureSelectTypeUtil
import com.yoo.ons.databinding.LayoutPictureAddBinding
import com.yoo.ons.dialog.PictureSelectTypePopup
import com.yoo.ons.model.PictureManagerModel

class PersonAlbumAddViewHolder(private val binding: LayoutPictureAddBinding) :
    RecyclerView.ViewHolder(binding.root) {
    fun bind(item: PictureManagerModel) {
        binding.itemAlbumAdd.setOnClickListener {
            Activities.get().top?.let { it1 ->
                PictureSelectTypePopup(
                    it1,
                    object : PictureSelectTypePopup.SelectListener {
                        override fun onSelectAlbumsListener() {
                            Activities.get().top?.let { it1 -> PictureSelectTypeUtil.openAlbum(it1) }
                        }

                        override fun onSelectCameraListener() {
                            Activities.get().top?.let { it1 -> PictureSelectTypeUtil.openCamera(it1) }

                        }

                    }).showPopupWindow()
            }
        }
    }
}